#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <stdio.h>
#include <QtWidgets>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QIcon>
#include <QAction>
#include <QMenu>
#include <QStatusBar>
#include <QMenuBar>
#include <QPushButton>
#include <QAudioDeviceInfo>
#include <QAudioFormat>
#include <QAudioOutput>
#include <QTimer>
#include <QByteArray>
#include <QIODevice>
#include "generator.h"
#include "GUI.h"
#include "plotter.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void audio_initializing();

    QWidget* central_widget;
    QHBoxLayout* hor_box;
    QGridLayout* ver_box;
    QHBoxLayout* bottom_hor_box;
    QHBoxLayout* bottom_plotter_box;
    QPushButton* play_button;
    QIcon* play_icon;
    QPushButton* stop_button;
// Top Stuff
    QLabel* top_label;
    QLabel* top_label2;
    GUI* left_channel;
    GUI* right_channel;

//    QAction* Arquivo;
    QMenu* Arquivo;
    QAction* Load;
    QAction* Save;
    QAction* Exit;

    QMenu* Editar;
    QMenu* Visualizar;
    QMenu* Ferramentas;
    QMenu* Ajuda;

    QAudioFormat m_format;
    QIODevice* m_output; // not owned
    bool m_pullMode;
    QByteArray m_buffer;
    QTimer* m_pullTimer;
    Generator* m_generator;
    QAudioOutput* m_audioOutput;
    QAudioDeviceInfo m_device;
    plotter* HarryPlotter;
    plotter* HarryPlotter_OD;
    plotter* HarryPlotter_OE;

private:

private slots:
    void start_sound();
    void stop_sound();
    void pullTimerExpired();
};

#endif // MAINWINDOW_H
